﻿<%@ Page Language="C#"  MasterPageFile="~/WebSite.Master" AutoEventWireup="true" CodeBehind="EnterpriseOrgCodeChangeList.aspx.cs" Inherits="RN.ERP.Web.EnterpriseChange.EnterpriseOrgCodeChangeList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" src="../Scripts/ligerUI/js/ligerui.all.js"></script>

    <style type="text/css">
        .style1
        {
            height: 33px;
            line-height: 33px;
            font-size: 14px;
            font-weight: bold;
            color: #fff;
            background: url('../images/xx_m.jpg') repeat-x;
            width: 19px;
        }
        .style2
        {
            background: url('../images/l_conlibg.jpg') repeat-y;
            width: 19px;
        }
        .style3
        {
            background: url('../images/con_m.jpg') repeat-x;
            width: 19px;
        }
    </style>
    <script type="text/javascript">
        $(function () {
            $("#btnManagerSearch").click(function () {
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
            });
            $("#<%= ddlStatus.ClientID %>").change(function () {
                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
            });
        });
        function AuditCorp(opt) {
            var chk = $("input:checked");
            if (chk.length == 0) {
                $.ligerDialog.warn("请选择要审核的变更信息！");
                return false;
            }
            if (chk.length > 1) {
                $.ligerDialog.warn("请选择一条变更信息进行审核！");
                return false;
            }
            $.ligerDialog.confirm("确定审核企业变更信息？", Post);
            return false;
            function Post(arg) {
                if (arg) {
                    var guid = chk.attr("value").split(';')[0];
                    $.getJSON("../Handlers/EnterpriseCorpInfoHandler.ashx", { "action": "AuditCorpOrgCode", "data": guid, "opt": opt, "content": "", "rand": Math.random() }, function (data) {
                        $.ligerDialog.warn(data.Message);
                        $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
                    }
            );
                }
            }
        }

        function RefreshChangeRecord() {
            $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
        }
        function ChangeOnClientClose() {
            $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
        }

        function RefreshGrid() {
            $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
        }
        
        //加载扫描件
        function ImgShow(corpUserGuid, orgCode) {
            var title = "查看组织机构代码扫描件";
            $.ligerDialog.open({ url: "../Enterprise/UploadFileShowList.aspx?title=" + escape(title) + "&fileName=" + corpUserGuid + "&fileType=.jpg&sysCode=EF&funcCode=CorpORGChange",
                width: 760, height: 650, title: '该企业组织机构代码为: ' + orgCode, isResize: true,
                buttons: [{ text: '关闭', onclick: function (item, dialog) { dialog.close(); } }]
            });
        }
        /*关闭窗口*/
        function OnClientCloseImg(args) {
            var arg = args;
            if (arg) {
                if (arg.Result == 1) {
                    return;
                }
            }
        }
        function returnToParent() {
            window.parent.$.ligerDialog.close(); ////关闭dialog
            parent.$(".l-dialog,.l-window-mask").hide(); ////去除父窗体遮罩层
        }

        /*打开添加扫描件窗口*/
        function ShowUpForm(u, w, h, win) {
            win = win || this;
            $.ligerDialog.open({ url: u, width: w, height: h, title: '', buttons: [{ text: '关闭', onclick: function (item, dialog) { dialog.close(); } }] });
            win.ChildDialogWin = this;
            return false;
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ListCorps" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
    <table width="100%" border="0" cellspacing="0" cellpadding="0" style="border-collapse: collapse;table-layout:fixed;padding: 0">
        <tr>
            <td class="xx_m  tt_xx_l"></td>
            <td class="xx_m  tt_xx_icon"></td>
            <td style="width:auto;" class="xx_m">企业变更列表</td>
            <td style="width:14px;"><img src="../images/xx_r.jpg" width="14" height="33" /></td>
        </tr>
        <tr>
            <td class="style2">
            </td>
            <td colspan="2" style="padding-top: 10px; padding-left: 6px;">
            <div>
                    <div class="xian" >
                        <div class="about_title">
                            企业变更列表</div>
                        <div class="i-con-cn" id="ManagerMenu" runat="server">
                            <input type="button" class="xtbiao" onclick="AuditCorp(6)" value="退回" />
                            <input type="button" class="xtbiao" onclick="AuditCorp(5)" value="审核" />
                            <input type="button" class="xtbiao" id="btnManagerSearch" value="查询" />
                        </div>
                    </div>
                    <asp:Panel ID="Panel1" runat="server" Style="margin-bottom: 5px;">
                        <table style="width: 100%; height: 40px; padding-bottom: 10px; padding-top: 10px;
                            background-color: #eaeaea; text-align: center;">
                            <tr>
                                <td width="90">
                                    企业名称
                                </td>
                                <td width="110">
                                    <div class="s_input">
                                        <span class="input_l">
                                            <img src="../images/input_l.jpg" width="10" height="31" alt="" /></span> <span class="input_mm">
                                                <asp:TextBox ID="txtCorpName" runat="server" Style="width: 200px; height: 31px; line-height: 31px;
                                                    border: 0; background: transparent"></asp:TextBox>
                                            </span><span class="input_r">
                                                <img src="../images/input_r.jpg" width="10" height="31" alt="" /></span>
                                    </div>
                                </td>
                                <td width="90">
                                    审核状态
                                </td>
                                <td width="">
                                    <div>
                                        <span class="input_l">
                                            <img src="../images/input_l.jpg" width="10" height="31" alt="" /></span> <span style="height: 31px;
                                                background: url(../images/input_m.jpg) repeat-x; float: left; overflow: hidden">
                                                <asp:DropDownList ID="ddlStatus" runat="server" Style="width: 100px; height: 20px;
                                                    line-height: 31px; margin-top: 5px; border: 0;">
                                                    <asp:ListItem Text="全部" Value=""></asp:ListItem>
                                                    <asp:ListItem Text="处理中" Value="0,019" Selected="True"></asp:ListItem>
                                                    <asp:ListItem Text="已处理" Value="1,019,029"></asp:ListItem>
                                                    <asp:ListItem Text="退回" Value="0,019,021"></asp:ListItem>
                                                </asp:DropDownList>
                                            </span><span class="input_r">
                                                <img src="../images/input_r.jpg" width="10" height="31" alt="" /></span>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                    <telerik:RadGrid ID="ListCorps" runat="server" AutoGenerateColumns="False" CellSpacing="0"
                        Width="100%" Culture="zh-CN" GridLines="None" AllowFilteringByColumn="false"
                        AllowPaging="true" AllowCustomPaging="true" AllowMultiRowSelection="true" OnNeedDataSource="ListCorps_NeedDataSource"
                        AllowSorting="false" ShowStatusBar="true">
                        <ClientSettings ReorderColumnsOnClient="True" AllowColumnsReorder="True" EnableRowHoverStyle="true">
                            <Resizing AllowRowResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="True"
                                AllowColumnResize="True"></Resizing>
                        </ClientSettings>
                        <MasterTableView AutoGenerateColumns="false" >
                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
                            </RowIndicatorColumn>
                            <Columns>
                                <telerik:GridTemplateColumn HeaderText="选择" HeaderStyle-Width="50px">
                                    <ItemTemplate>
                                        <input id="ckb" type="checkbox" value='<%#Eval("CorpUserGuid")%>'
                                            runat="server" />
                                    </ItemTemplate>
                                    <ItemStyle Width="50px"></ItemStyle>
                                </telerik:GridTemplateColumn>
                                
                                <telerik:GridTemplateColumn  HeaderText="企业名称" ItemStyle-Width="200px">
                                    <ItemTemplate>
                                         <%#Eval("CorpName")%>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn  HeaderText="组织机构代码" HeaderStyle-Width="100px">
                                    <ItemTemplate>
                                    <%#Eval("OrgCode")%>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn  HeaderText="查看组织机构代码扫描件" HeaderStyle-Width="150px">
                                    <ItemTemplate>
                                    <a href="javascript:void(0)" title="查看扫描件" onclick="ImgShow('<%#Eval("CorpUserGuid") %>','<%#Eval("OrgCode") %>')">
                                    <span style="color: #43a9f5">查看扫描件</span></a>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridBoundColumn DataField="PostDate" HeaderText="申请时间" HeaderStyle-Width="100px" DataFormatString="{0:yyyy-MM-dd}">
                                </telerik:GridBoundColumn>
                                <telerik:GridTemplateColumn  HeaderText="审核状态" >
                                    <ItemTemplate>
                                    <%# Eval("StrFlowCode")%>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                            </Columns>
                        </MasterTableView>
                        <ClientSettings EnableRowHoverStyle="true">
                        </ClientSettings>
                        <PagerStyle AlwaysVisible="True" />
                        <FilterMenu EnableImageSprites="False">
                        </FilterMenu>
                    </telerik:RadGrid>
                </div>
            </td>
            <td class="right_con">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td class="style3">
                <img src="../images/left_bottom.jpg" width="19" height="24" alt="" />
            </td>
            <td colspan="2" class="con_m">
                &nbsp;
            </td>
            <td>
                <img src="../images/right_bottom.jpg" width="14" height="24" alt="" />
            </td>
        </tr>
    </table>
    <asp:HiddenField ID="hdnCorpUserGuid" runat="server" />
    <asp:HiddenField ID="hdnCorpName" runat="server" />
</asp:Content>